﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CheckTask.aspx.cs" Inherits="Task_CheckTask" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register src="ucSearchTask.ascx" tagname="ucSearchTask" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>任务审核</title>
    <link href="../css/f_css.css" rel="stylesheet" type="text/css" />
    <link href="../css/listpage.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="../js/jquery-1.2.6.pack.js"></script>
    <script language="javascript" src="../js/subMsg.js" type="text/javascript"></script>
    <script language="javascript" src="../js/common.js" type="text/javascript"></script>
    <script language="javascript" src="../js/qmailDataGrid.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        createQMailObj("8", "200px", "ShowTaskSimple.aspx");
        $(document).ready(function() {
            var divSearch = getx("divSearch");
            divSearch.style.display = "none";
        });
    </script>
    <script language="javascript" type="text/javascript">
         function preCheckItems(gvID, confimrMsg) {
            if (0 == getCheckedItemsCount(gvID))
            {
                msgWarning('没有选择记录');
                return false;
            }
            if (confimrMsg) {
                if (!confirm(confimrMsg)) {
                    return false;
                }
            }
            return true;
         }
    </script>
    <script language="javascript" type="text/javascript">
        function onRowStatusChanged(chk, rowIndex) {
            var tr = chk.parentNode.parentNode;
            if (chk.checked) {
                tr.style.backgroundColor = "#d6e2f6";
            }
            else {
                tr.style.backgroundColor = "";
            }
        }
    </script>
    <script language="javascript" type="text/javascript">
        function checkTask(id) {
            var hfTaskID = getx("hfSelectedTaskID");
            hfTaskID.value = id.toString();
            var url = "Task/EditTaskCheckInfoDlg.aspx";
            window.parent.document.openDialog(url, "填写审核信息", checkTaskCallback, 435, 250);
        }
        function checkTaskCallback(type, key, value) {
            if (type == 1) {
                var hfCheckNote = getx("hfCheckNote");
                hfCheckNote.value = value;
                getElementAndClick("btnCheckTask");
            }
        }
    </script>
    <style type="text/css">
    #gv th
    {
        border:none;
    }
    #gv td
    {
        border-top:none;
        border-left:none;
        border-right:none;
        border-bottom:solid 1px #EEEEEE;
    }
    .right
    {
        float: right;
    }
    #divSearch{border:2px solid #fcc400; height:auto; min-height:40px; padding:3px; display:none;}
    .searchCtrl{width:80px; float:left;}
    .schItem{width:230px; float:left; height:22px; line-height:22px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="titleText">
        审核任务 <span style="font-size: 12px; font-weight: normal;">(未审核
        <asp:Label runat="server" ID="lblTotal" Text="0"></asp:Label>)</span>
    </div>
    <div class="btdiv2">
            <asp:Button ID="btnRefresh" runat="server" CssClass="input00" Text="刷新" 
                onclick="btnRefresh_Click" />
            <input type="button" onclick="javascript:toggleVisibleByID('divSearch');" class="input00" value="查找任务" />
            <input type="button" value="批量审核任务" class="input00"
                onclick="javascript:if(!preCheckItems('gv')){return false;} checkTask(-1);" />
            <span style="display:none;"><asp:Button ID="btnCheckTask" runat="server" Text="审核任务"
                OnCommand="btnCheckTask_Command" /></span> 
            <asp:HiddenField runat="server" ID="hfSelectedTaskID" />
            <asp:HiddenField runat="server" ID="hfCheckNote" />
        <div class="right">
            <webdiyer:AspNetPager ID="pager" CssClass="pager" runat="server" CustomInfoHTML="%CurrentPageIndex%/%PageCount%页&nbsp;&nbsp;"
                CustomInfoSectionWidth="12%" CustomInfoTextAlign="Right" 
                FirstPageText="首页" LastPageText="末页"
                LayoutType="Table" NextPageText="下一页" NumericButtonCount="6" NumericButtonTextFormatString="[{0}]"
                PageSize="20" PagingButtonSpacing="2px" PrevPageText="上一页" ShowCustomInfoSection="Left"
                SubmitButtonText="转到" onpagechanged="pager_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    <div id="divSearch">
        <div class="schItem"><div class="searchCtrl">案件编号：</div><asp:TextBox runat="server" ID="txtCaseIndex" CssClass="conint singleline"></asp:TextBox></div>
        <div class="schItem"><div class="searchCtrl">任务名：</div><asp:TextBox runat="server" ID="txtTaskName" CssClass="conint singleline"></asp:TextBox></div>
        <div class="schItem"><div class="searchCtrl">开始时间：</div>
        <asp:DropDownList runat="server" ID="drpStartTime" Width="120px">
            <asp:ListItem>不限</asp:ListItem>
            <asp:ListItem>当天</asp:ListItem>
            <asp:ListItem>最近三天</asp:ListItem>
            <asp:ListItem>本周</asp:ListItem>
            <asp:ListItem>本月</asp:ListItem>
        </asp:DropDownList></div>
        <div class="schItem"><div class="searchCtrl">优先级：</div>
            <asp:CheckBox runat="server" ID="chkNormal" Text="普通" Checked="true" />
            <asp:CheckBox runat="server" ID="chkHigh" Text="高" Checked="true" />
            <asp:CheckBox runat="server" ID="chkLow" Text="低" Checked="true" />
        </div>
        <div style="clear:both; height:2px;"></div>
        <div>
        <asp:CheckBox runat="server" ID="chkCheckedTask" Text="已审核任务" />
        <asp:Button runat="server" ID="btnOK" Text="确定" CssClass="input00" 
            onclick="btnSearch_Click" />
        </div>
    </div>
    <div style="clear:both;"></div>
    <div class="tableContaner">
        <asp:GridView ID="gv" runat="server" CssClass="table2" 
            AutoGenerateColumns="False" onrowdatabound="gv_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderStyle-Width="20px" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <input type="checkbox" onclick="javascript:checkAll(this);" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="chk" onclick='<%# "javascript:onRowStatusChanged(this, " + Container.DataItemIndex + ");"%>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField HeaderText="案件编号" DataField="CaseIndex" />
                <asp:BoundField HeaderText="任务名" DataField="TaskName" />
                <asp:BoundField HeaderText="状态" DataField="Status" />
                <asp:TemplateField HeaderText="开始日期">
                    <ItemTemplate><%# FormatDateTime(Eval("StartDateTime"), false)%></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="内部时限">
                    <ItemTemplate><%# FormatDateTime(Eval("InnerDeadlineDate"), false)%></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="外部时限">
                    <ItemTemplate><%# FormatDateTime(Eval("OuterDeadlineDate"), false)%></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作" ItemStyle-Width="100px">
                    <ItemTemplate>
                        <a href="javascript:void(0);" onclick='javascript:showDetail(this,<%# Eval("AID") %>);' title="查看详细信息">详细</a>
                        <asp:LinkButton runat="server" ID="lkCheck" ToolTip="填写信息并确定审核"
                            CommandArgument='<%# Eval("AID") %>' OnCommand="lkCheck_Command"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="listhead" />
            <AlternatingRowStyle CssClass="alt" />
        </asp:GridView>
    </div>
        <div class="btdiv2">
            &nbsp;&nbsp;<div class="right">
            <webdiyer:AspNetPager ID="pager2" runat="server" CssClass="pager" CustomInfoHTML="%CurrentPageIndex%/%PageCount%页&nbsp;&nbsp;"
                CustomInfoSectionWidth="12%" CustomInfoTextAlign="Right" 
                FirstPageText="首页" LastPageText="末页"
                LayoutType="Table" NextPageText="下一页" NumericButtonCount="6" NumericButtonTextFormatString="[{0}]"
                PageSize="20" PagingButtonSpacing="2px" PrevPageText="上一页" ShowCustomInfoSection="Left"
                SubmitButtonText="转到" onpagechanged="pager2_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
    </form>
</body>
</html>
